(rmail-output): Bind buffer-file-coding-system even when rmail-enable-mime is nil.
authorHenrik Enberg <henrik.enberg@telia.com>
Fri, 27 Apr 2007 21:32:39 +0000 (21:32 +0000)
committerHenrik Enberg <henrik.enberg@telia.com>
Fri, 27 Apr 2007 21:32:39 +0000 (21:32 +0000)
lisp/mail/rmailout.el

index 26724ee77a56aac3f6d3bf76f1516fdd4e3fd87d..7224ce91f682bf1f9663362cc02f95c0f6e15f82 100644 (file)
@@ -169,6 +169,10 @@ The optional fourth argument FROM-GNUS is set when called from GNUS."
        (while (> count 0)
          (with-temp-buffer
            (insert-buffer-substring rmailbuf)
+           ;; ensure we can write without barfing on exotic characters
+           (setq buffer-file-coding-system
+                 (or rmail-file-coding-system 'raw-text))
+           ;; prune junk headers
            (rmail-delete-unwanted-fields)
            (if (not destbuf)
                ;; The destination file is not being visited, just write